

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%
//esto es para que no guarde en el cache la pagina
response.setHeader("Cache-Control","max-age=0");
response.setHeader("Cache-Control","no-cache");
response.setHeader("Cache-Control","no-store");
response.setHeader("Pragma","no-cache");
response.setDateHeader ("Expires", -1);
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <%
        HttpSession s= request.getSession();
        if(s.getAttribute("logged")!=null && s.getAttribute("logged").equals(true)){
        %>
        <h1>Hello World!</h1>
         <%}else{
        response.sendRedirect(request.getContextPath()+"/index.jsp");
        }%>
    </body>
</html>
